package com.atguigu.srb.core.controller.admin;


import com.atguigu.srb.base.config.JwtUtils;
import com.atguigu.srb.commom.exception.Assert;
import com.atguigu.srb.commom.result.R;
import com.atguigu.srb.commom.result.ResponseEnum;
import com.atguigu.srb.commom.untis.RegexValidateUtils;
import com.atguigu.srb.core.Vo.LoginVo;
import com.atguigu.srb.core.Vo.RegisterVO;
import com.atguigu.srb.core.Vo.UserInfoQuery;
import com.atguigu.srb.core.Vo.UserInfoVo;
import com.atguigu.srb.core.pojo.entity.UserInfo;
import com.atguigu.srb.core.service.UserInfoService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 用户基本信息 前端控制器
 * </p>
 *
 * @author lay_hu
 * @since 2021-12-13
 */
@Api(tags = "会员查询")
@RestController
@RequestMapping("/admin/core/userInfo")
@Slf4j
//@CrossOrigin
public class AdminUserInfoController {

    @Resource
    UserInfoService userInfoService;
    @ApiOperation("分页查询")
    @GetMapping("/listquery/{page}/{limit}")
    public R listQuery(
                         @ApiParam(value = "分页查询的页数",required = true)
                        @PathVariable long page,
                         @ApiParam(value = "分页查询的个数",required = true)
                       @PathVariable long limit,
                         @ApiParam(value = "分页查询的的集合类")
                       UserInfoQuery userInfoQuery){
        Page<UserInfo> userInfoPage = new Page<>(page, limit);
        IPage<UserInfo> pageModel=  userInfoService.listPage(userInfoPage,userInfoQuery);

        return  R.ok().data("pageModel",pageModel).message("注册成功");

    }

}

